package com.focusai.efairy.ui.adapter;

import android.content.Context;
import android.widget.ImageView;

import com.bumptech.glide.load.engine.DiskCacheStrategy;
import com.focusai.efairy.R;
import com.focusai.efairy.ui.adapter.base.BaseRecyclerAdapter;
import com.focusai.efairy.ui.adapter.base.BaseRecyclerViewHolder;
import com.focusai.efairy.utils.ImageLoadUtils;

/**
 * Created by luo_guangwen on 2017/10/13.
 */

public class SelectImgGirdAdapter extends BaseRecyclerAdapter<String> {

    public SelectImgGirdAdapter(Context context) {
        super(context);
    }

    @Override
    protected int getItemLayoutId() {
        return R.layout.item_select_img;
    }

    @Override
    protected void onBindBaseRecyclerViewHolder(BaseRecyclerViewHolder holder, int position) {
        ImageView imageView = holder.getImageView(R.id.item_iv);
        if (!mList.get(position).equals("last")){
            ImageLoadUtils.displayImage(mContext, imageView,
                    mList.get(position), ImageLoadUtils.getOptions()
                            .diskCacheStrategy(DiskCacheStrategy.NONE));
        }else {
            ImageLoadUtils.displayImage(mContext, imageView,
                    R.drawable.icon_input_img, R.drawable.icon_input_img, ImageLoadUtils.getOptions()
                            .diskCacheStrategy(DiskCacheStrategy.NONE));
        }
    }
}

